#ifndef __HardwareProfile_h__
#define __HardwareProfile_h__

#include <htc.h>
#define _XTAL_FREQ 4000000
#define T1CYCLE 15536 //100ms
//#define T3CYCLE1 3036 //125ms
//#define T3CYCLE2 15536 //100ms
#define WFRomOperation
#include "FlagDefine.h"
#include "afx.h"
#include "TypeDefine.h"
#include "Verify.h"


#define RS485DE_W RB1
#define RS485DE_IO	TRISB1
#define Uart_TRMT TRMT
#define Uart_TXREG TXREG
#include "Uart.h"
#include "CP1616_Client.h"

#define SimI2C
#define SimI2C_CLK_IO TRISC4
#define SimI2C_DATA_IO TRISC5
#define SimI2C_CLK_W RC4
#define SimI2C_DATA_W RC5
#define SimI2C_DATA_R RC5
#include "SimI2C.h"
#define ADS1112_RetryCount 50
#include "ADS1112.h"

//GFlags gFlags;
_PT_Value PT_Value;
unsigned int NoAdjustP;
unsigned int NoAdjustT;
unsigned char ADTimes;
unsigned int T_ADSum;
unsigned int P_ADSum;
unsigned int T_AD_Value;
unsigned int P_AD_Value;
unsigned int SystemTick;
unsigned int ADTick;
unsigned int PTRTick;
unsigned char GetPAD(void);
unsigned char GetTAD(void);
void PProcess(void);
void TProcess(void);

void ProcCommandFromMainframe( void );
#endif
